<template>
  <div>
    <button @click="isShow = !isShow">显示/隐藏</button>

    <transition name="cheng">
      <h1 v-show="isShow">你好</h1>
    </transition>

    <transition name="jing">
      <h4 v-show="isShow">你好</h4>
    </transition>
  </div>
</template>

<script>
  export default {
    name:'App',
    data() {
      return {
        isShow:true
      }
    },
  }
</script>

<style>
  h1 {
    background-color: orange;
  }
  h4 {
    background-image: linear-gradient(45deg,red,yellow,pink,green);
  }
  @keyframes dongqilai {
    from{
      transform: translateX(0);
    }
    to{
      transform: translateX(-100%);
    }
  }
  .cheng-leave-active {
    animation: dongqilai linear 10s;
  }
  .cheng-enter-active {
    animation: dongqilai linear 10s reverse;
  }
  .jing-leave-active {
    animation: dongqilai linear 1s;
  }
  .jing-enter-active {
    animation: dongqilai linear 1s reverse;
  }
</style>